package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.system.domain.WorkDetailDTO;
import com.ruoyi.system.mapper.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.WorksMapper;
import com.ruoyi.system.domain.Works;
import com.ruoyi.system.service.IWorksService;

/**
 * 【请填写功能名称】Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-25
 */
@Service
public class WorksServiceImpl implements IWorksService 
{
    @Autowired
    private WorksMapper worksMapper;
    @Autowired
    private SysUserMapper userMapper;


    @Override
    public Works selectWorksByWorkId(Long workId)
    {
        //根据作品id查询作家信息

        return worksMapper.selectWorksByWorkId(workId);
    }


    @Override
    public List<Works> selectWorksList(Works works)
    {
        return worksMapper.selectWorksList(works);
    }
    @Override
    public List<Works> selectWorksLists(Works works)
    {
        return worksMapper.selectWorksLists(works);
    }


    @Override
    public int insertWorks(Works works)
    {
        return worksMapper.insertWorks(works);
    }


    @Override
    public int updateWorks(Works works)
    {
        return worksMapper.updateWorks(works);
    }


    @Override
    public int deleteWorksByWorkIds(Long[] workIds)
    {
        return worksMapper.deleteWorksByWorkIds(workIds);
    }


    @Override
    public int deleteWorksByWorkId(Long workId)
    {
        return worksMapper.deleteWorksByWorkId(workId);
    }

    @Override
    public int selecUserIdByWorkId(Long workId) {
        return 0;
    }


    @Override
    public WorkDetailDTO getWorkDetail(Long workId) {
        return worksMapper.selectWorkDetailByWorkId(workId);
    }

}
